import { defineConfig } from 'umi';
import theme from './theme';

export default defineConfig({
  locale: {
    default: 'zh-CN',
    antd: true,
  },
  mock: false,
  //history: { type: 'hash' },
  theme,
  targets: { ie: 10 },
  proxy: {
    '/usercenter-admin-app/admin': {
      // target: 'http://uc-web-feature.ingress.dayu.work/',
      // target: 'http://47.98.104.60/',
      target: 'http://localhost:8080/',
      headers: {
        Cookie: "xxl_sso_sessionid=111111111_3968a1baca974c8caf42653172696155",
      },
      changeOrigin: true,
      secure: false,
      // 'pathRewrite': { '^/api' : '' },
      // bypass: function (req, res, proxyOptions) {
      //   if (req.headers.accept.indexOf('html') !== -1) {
      //     return '/index.html';
      //   }
      // },
    },
  },
  devServer: {
    port: 80,
  },
  publicPath: '/usercenter-admin-web/',
  base: '/usercenter-admin-web/',
  outputPath: './dist',
});
